#ifndef SERIAL_API_H
#define SERIAL_API_H
//http://ru.wikibooks.org/wiki/COM-%D0%BF%D0%BE%D1%80%D1%82_%D0%B2_Windows_%28%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%BC%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5%29#.D0.9E.D1.82.D0.BA.D1.80.D1.8B.D1.82.D0.B8.D0.B5_.D0.BF.D0.BE.D1.80.D1.82.D0.B0
 #include <windows.h>
 
 #include <vector>
 #include <string>
 
 using namespace std;
 struct TTYSettings
 {
	 int dwInQueue;
	 int dwOutQueue;
	 int baudrate;
	 int l_TIMEOUT;
	 int read_interval;
 };

 struct TTY {
 
 	TTY();
 	virtual ~TTY();
	TTYSettings main_settings;
 	bool IsOK() const;
 
 	bool Connect(const string& port, int baudrate);
 	void Disconnect();
 
 	virtual void Write(const vector<	unsigned char>& data);
 	virtual bool Read(vector<	unsigned char>& data);
 
 	HANDLE m_Handle;
	
 
 };
 
 struct TTYException {
 };


#endif